package cn.richard.demo.xml.bean;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@XmlRootElement(name = "Document", namespace = "urn:iso:std:iso:20022:tech:xsd:pain.001.001.03") //根元素
@XmlAccessorType(XmlAccessType.FIELD)
public class Student2 {
	@XmlAttribute
	private String type;
	
	@XmlElement
	private Integer id;
	@XmlElement
	private String name;
	@XmlElement
	private Integer age;

	@XmlElement
	private Eye eye;
	
	//兴趣s
	@XmlElementWrapper(name = "hobbies")
	private List<Hobby> hobby;

	public Student2(Integer id, String name, Integer age) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
	}
}

